<template>
	<view class="text">
		<view :class="item==0 ? 'active' : '' " @tap='changItem' data-item="0">全部</view>
		<view :class="item==1 ? 'active' : '' " @tap='changItem' data-item="1">待支付</view>
		<view :class="item==2 ? 'active' : '' " @tap='changItem' data-item="2">已失效</view>
		<view :class="item==3 ? 'active' : '' " @tap='changItem' data-item="3">核保</view>
	</view>
</template>

<script>
	export default {
		name: "tabbar",
		data() {
			return {
				item: 0
			}
		},
		methods: {
			changItem(e) {
				this.item = e.target.dataset.item
			}
		}
	}
</script>

<style scoped lang="scss">
	.text {
		display: flex;
		margin-top: 10upx;
		border-bottom: 1px solid #ccc;

		view {
			flex: 1;
			text-align: center;
		}
	}

	.active {
		border-bottom: 1px solid red;
		color: red;
		padding-bottom: 10rpx;
	}
</style>
